﻿using System.Runtime.Serialization;

namespace RockBus.Monitoring.DataContracts.Configuration
{
    /// <summary>
    /// Holds the performance counter specific configuration for the purpose of collecting performance counter values.
    /// </summary>
    [DataContract(Namespace = NamespaceConstants.MonitoringNamespace)]
    public class PerformanceCounterConfiguration : PerformanceCounterConfigurationBase
    {
        /// <summary>
        /// Specifies the string format of the performance counter, i.e. 'Memory\pages/sec'. Identical to the format used by perfmon and logman.
        /// </summary>
        public const string PerformanceCounterNameFormat = @"{0}\{1}";

        /// <summary>
        /// Returns the full name of the performance counter, using the PerformanceCounterNameFormat. Uses the same format as perfmon and logman (i.e. 'Memory\pages/sec').
        /// </summary>
        public override string FullName
        {
            get { return string.Format(PerformanceCounterNameFormat, this.CategoryName, this.CounterName); }
        }
    }
}